Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GSMemoryPanel: Only call GSDebug* in debug mode #289

Merged
merged 1 commit into from
Sep 14, 2024

Conversation

qmfrederik
Copy link
Contributor

@qmfrederik qmfrederik commented Sep 12, 2024

The GSDebug* methods are conditional on NDEBUG not being defined; so do not attempt to call these methods if this variable is not set.

The current implementation causes a build warning/error:

error: call to undeclared function 'GSDebugAllocationActive'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

The GSDebug* methods are conditional on NDEBUG not being defined; so do not attempt to call these methods if this variable is not set.
@fredkiefer
Copy link
Member

The problem is that these functions are defined in base and used here in gui. There is no way that we can guarantee that both libraries are compiled with matching flags. Still in some cases your change hopefully makes the setup more consistent.

@fredkiefer fredkiefer merged commit 3784462 into gnustep:master Sep 14, 2024
3 checks passed
@rfm
Copy link
Contributor

rfm commented Sep 14, 2024

Perhaps this should be considered a bug in base ... I don't think the presence of the functions should be determined by NDEBUG

@qmfrederik
Copy link
Contributor Author

Perhaps the implementation in base should be a no-op if NDEBUG is set, rather than the functions being undefined?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants